<?php

namespace App\Lib\EmailAlert;

use App\Models\Article;

class NewArticlePublishTemplate extends Template
{

    private $article;

    public function __construct($id=0)
    {
        if ($id) {
            $this->article = Article::find($id);
        } else {
            $this->article = (new Article())->whereNotNull('publish_date')->orderBy('id', 'desc')->first();
        }
        // print_r($this->article);exit;
    }


    public function subject()
    {
        return $this->article->title;
    }

	public function body()
	{
		$html = '<p style="margin-bottom:0px;">
    <img alt="" title="" src="' . asset('/images/zr_header.jpg') . '" width="1096" height="210"/>
</p>
<p style="width: 1086px;background-color:#076919; margin-top:-5px; padding: 10px 5px">
    <span style="font-size: 14px; color: #fff;">欢迎访问《动物学研究》网站（<a style="color: #fff;text-decoration: none;" href="www.zoores.ac.cn" target="_blank">www.zoores.ac.cn</a>）,&nbsp; 浏览更多精彩文章。</span><span style="color: #fff;float:right; font-size: 12px;">[<a target="_blank" href="http://www.zoores.ac.cn/EN/column/column79.shtml" style="color: #fff;text-decoration: none;"><strong>期刊简介</strong></a>] [<a target="_blank" style="color: #fff;text-decoration: none;" href="http://www.zoores.ac.cn/EN/column/column117.shtml"><strong>投稿须知</strong></a>] [<a style="color: #fff;text-decoration: none;" href="http://www.zoores.ac.cn/EN/column/column83.shtml" target="_blank"><strong>联系我们</strong></a>]</span>
 &nbsp; &nbsp; &nbsp; &nbsp;
</p>
<p>
    <br/>
</p>
<table width="1096">
    <tbody>
        <tr class="firstRow">
            <td style="border-width: 1px; border-style: solid; border-color:#ccc;padding: 20px;" valign="top">
                <p>
                    <span style="font-size: 14px;">Dear colleagues,</span>
                </p>
                <p style="">
                    <span style="font-size: 14px;">We are glad to announce that a paper entitled "<a style="color:rgb(84,141,212); font-weight:bold;" href="' . route('article.index', ['id' => $this->article->id] ) . '" target="_blank">' . $this->article->title . '</a>" has been recently published in the Zoological Research (ZR). We hope that these new results may provide you helpful information. Your valuable comments will be greatly appreciated.</span>
                </p>
                <p style="padding-top: 8px;">
                    <span style="font-size: 14px;"><a href="' . route('article.index', ['id' => $this->article->id] ) . '">' . $this->article->pureAuthorList() . '</a></span>
                </p>
                <p style="text-indent: 0em;"></p>
                <p style="text-indent: 0em;">
                    <span style="font-size: 14px;">This service is also expected to introduce the latest relevant advances reported in ZR.<br/></span>
                </p>
                <p style="text-indent: 0em;">
                    <span style="font-size: 14px;">Best regards,<br/></span>
                </p>
                <p style="text-indent: 0em;float: left;width: 600px">
                    <img alt="" title="" src="' . asset('/images/qianming.jpg') . '" />
                </p>
                <p style="text-indent: 0em;float: right;">
                    <img width="100" alt="" title="" src="' . asset('/images/email/dongwuxueyanjiu3.png') . '" />
                </p>
                
                <p style="text-indent: 0em; padding-top: 8px;width: 1000px; float: left;">
                    <span style="font-size: 14px;">Yong-Gang YAO, Editor-in-Chief<br/>
Kunming Institute of Zoology, Chinese Academy of Sciences,<br/>
32 Jiaochang Donglu,Kunming, Yunnan 650223, China.<br/>
Tel: +86 871 65199026<br/>
E-mail:<a href="mailto:zoores@mail.kiz.ac.cn">zoores@mail.kiz.ac.cn</a><br/>
Homepage:<a href="http://www.zoores.ac.cn/">http://www.zoores.ac.cn/</a>
</span>
                </p>
            </td>
            
        </tr>
        <tr>
            <td style="border-width: 1px; border-style: solid;padding: 20px;" valign="top">
                <p style="text-indent: 0em;">
                    <span style="font-weight:bold; font-size: 10pt; "><a style="color: #969442;" href="' . route('article.index', ['id' => $this->article->id] ) . '">' . $this->article->title . '</a></span>
                </p>

                <p style="font-size:13px;padding-top: 8px;"><a style="TEXT-DECORATION: none; COLOR: #a66000" href="" target="_blank"><b><i>Free</i></b> Full Text (Abstract)</a>     <a style="TEXT-DECORATION: none; COLOR: #a66000" href="" target="_blank"><b><i>Free</i></b> Full Text (Abstract)</a></p>
                    <p style="font-size:13px;"><span style="font-size:12px;display:inline; color:#666666;"><i>' . $this->article->pureAuthorList() . '</i></span></p>
                <p style="padding: 5px 0px 5px 0px;font-size:14px; margin:0px; color: #666666;">
                    <strong>Abstract:</strong>&nbsp;' . $this->article->abstract . '
                </p>
            </td>
        </tr>


        <tr>
            <td style="border-width: 1px; border-style: solid;padding: 20px;" valign="top">
                <p style="color:#333333; font-size: 12pt;">All articles published in Zoological Research are included in:</p>
                <p style="text-indent: 4em;">
                    <ul class=" list-paddingleft-2" style="list-style-type: disc;">
                        <li><p style="color:#333333; font-size: 12pt;">Biological Abstracts</p></li>
                        <li><p style="color:#333333; font-size: 12pt;">BIOSIS Previews</p></li>
                        <li><p style="color:#333333; font-size: 12pt;">DOAJ</p></li>
                        <li><p style="color:#333333; font-size: 12pt;">PubMed</p></li>
                        <li><p style="color:#333333; font-size: 12pt;">PubMed Central</p></li>
                        <li><p style="color:#333333; font-size: 12pt;">Zoological Records</p></li>
                        <li><p style="color:#333333; font-size: 12pt;">Scopus</p></li>
                    </ul>
                </p>
            </td>
        </tr>
    </tbody>
</table>';

// <p style="font-size: 12px; margin: 0px;">
//     版权所有© 《动物学研究》编辑部 &nbsp;Tel: 0871-65199026 内线: 8224<br/>地址:昆明市教场东路32号 中国科学院昆明动物研究所 &nbsp;邮编：330045
// </p>

		return $html;
	}
}